Adding the Manage Members Page - #649
Conversation
|
I added tests for the new Manage Members helper logic. The tests cover the smaller helper functions separately so the behavior is easier to verify and debug:
I marked the database-dependent tests with All tests in |
…dentSoftwareDevTeam/lsf into Bright_Artem_manage_people
…dentSoftwareDevTeam/lsf into Bright_Artem_manage_people
There was a problem hiding this comment.
As you can see here I created a form under wario nakazawa
there is no approve form but it is showing active here
eventhough wario has no approved form yet.
But when i look there is a approved secondary for Elehah for secondary so that might influence the result. Moreover, there is a problem where
as you can see scott has active secondary but in the manage member it only shows pending.
|
I addressed the latest review feedback across the Manage Members PR. I cleaned up the imports, moved currentYear to g.currentYear using the same before_request pattern as g.currentUser, restored the positions route so this PR stays within Manage Members scope, renamed the count helper to getActivePendingPositionCounts, updated the route variable names to be more descriptive, and refactored the tests so each function has one test named test_functionName with scenarios handled inside that test. I also fixed the broken test by matching the helper signature and adding FormHistory rows for the Labor Status Form scenarios, so the test follows the actual count logic. I reran: pytest tests/code/test_departmentPortal.py tests/code/test_manageMembers.py -q and the tests pass locally. |
|
@MImran2002 The problem was that the app was reusing the cached currentUser from the Flask session. So if someone logged in as a Labor Admin, logged out, and then logged in as a student, the session could still contain the old Labor Admin user. That allowed the student to access Manage Members until the cookies were cleared. The same issue also happened in reverse, where logging back in as a Labor Admin could still show the old student permissions. I fixed this by checking the username from the current request against the cached currentUser in the session. If they match, the app keeps using the cached user. If they do not match, the old currentUser and username are removed from the session and the correct user is loaded again through require_login. I also updated require_login so session['username'] is refreshed when the logged-in user changes. The focused Manage Members and Department Portal tests pass locally with 5 passed. |
…' into Bright_Artem_manage_people
Removed Bright Feitsop from contributors and updated Bhushan Sah's year.
83b34d4 to
35dbd4d
Compare




We have added the Manage Members page, which can be accessed through the Members card on the Department Portal.
WHAT'S WORKING:
WHAT'S NOT WORKING: